<template>
  <div style='text-align:center;'>
    <i :class="mclass" :style="mstyle" :title="mtitle"></i>
  </div>
</template>
<script>
  export default {
    data(){
      return {
        mclass:{},
        mstyle:{},
        mtitle:''
      }
    },
    created(){
      switch(this.flag){
        case -1:
          this.$set(this.mclass, 'iconfont icon-bohui', true);
          this.$set(this.mstyle, 'color', '#F56C6C');
          if (this.titles) {
            for(var i = 0;i < this.titles.length; i++) {
              if (this.titles[i].status == this.flag) {
                this.mtitle= this.titles[i].title;
              }
            }
          }
          break;
        case 0:
          this.$set(this.mclass, 'el-icon-circle-close-outline', true);
          this.$set(this.mstyle, 'color', '#F56C6C');
          if (this.titles) {
            for(var i = 0;i < this.titles.length; i++) {
              if (this.titles[i].status == this.flag) {
                this.mtitle= this.titles[i].title;
              }
            }
          }
          break;
        case 1:
          this.$set(this.mclass, 'el-icon-circle-check-outline', true);
          this.$set(this.mstyle, 'color', '#409EFF');
          if (this.titles) {
            for(var i = 0;i < this.titles.length; i++) {
              if (this.titles[i].status == this.flag) {
                this.mtitle= this.titles[i].title;
              }
            }
          }
          break;
        case 2:
          this.$set(this.mclass, 'iconfont icon-weiwancheng', true);
          this.$set(this.mstyle, 'color', '#409EFF');
          if (this.titles) {
            for(var i = 0;i < this.titles.length; i++) {
              if (this.titles[i].status == this.flag) {
                this.mtitle= this.titles[i].title;
              }
            }
          }
          break;
        case 3:
          this.$set(this.mclass, 'iconfont icon-daichuli', true);
          this.$set(this.mstyle, 'color', '#F56C6C');
          if (this.titles) {
            for(var i = 0;i < this.titles.length; i++) {
              if (this.titles[i].status == this.flag) {
                this.mtitle= this.titles[i].title;
              }
            }
          }
          break;
        case 4:
          this.$set(this.mclass, 'iconfont icon-mianshen', true);
          this.$set(this.mstyle, 'color', '#409EFF');
          if (this.titles) {
            for(var i = 0;i < this.titles.length; i++) {
              if (this.titles[i].status == this.flag) {
                this.mtitle= this.titles[i].title;
              }
            }
          }
          break;
        default:
          break;
      }
    },
    props:["flag","titles"]
  }
</script>
